package com.sbtr.business.trainingtask.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sbtr.business.trainingtask.mapper.TrainingAssignMapper;
import com.sbtr.business.trainingtask.service.ITrainingAssignService;
import com.sbtr.business.trainingtask.entity.TrainingAssign;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 * 训练任务分配表，记录训练任务分配到那个训练服务器上 服务实现类
 * </p>
 *

 */
@Transactional
@Service
public class TrainingAssignServiceImpl extends ServiceImpl<TrainingAssignMapper, TrainingAssign> implements ITrainingAssignService {


    public List<TrainingAssign> listByTask(long taskId) {
        QueryWrapper<TrainingAssign> wrapper = new QueryWrapper<>();
        wrapper.eq("task_id", taskId);
        List<TrainingAssign> list = baseMapper.selectList(wrapper);
        return list;
    }

}
